$(function() {
	var grid;
	var url=null;
	var operation = {
			addFun : rootPath + '/industry/addUI.shtml',
			editFun: rootPath + '/industry/editUI.shtml?id=',
			delFun : rootPath + '/industry/deleteEntity.shtml',
			editdropdownFun :rootPath + '/actdropdown/actdropdownList.shtml?id='
		}
	$.ajax({
		url:rootPath + '/industry/getButton.shtml',//请求获取按钮
		success:function(data){
			var button = data;
			if(button !== ''){
				  button = button.replace("\"","");
				  button = button.replace("\"","");
		        }
			grid = TableData({
				gaine : 'paging',//id名
				table:'industry',
				column : [ {
					colkey : "id",
					name : "id",
				}, {
					colkey : "granddescription",
					name : "祖父级描述",
				}, {
					colkey : "fatherdescription",
					name : "父级描述",
				},{
					colkey : "fulldescription",
					name : "级别",
				} ,{
					colkey : "operation",
					name : "操作",
					"orderable": false,
					render:function(data,type,row,meta){
						return button;
					}
				}
				],
				url : rootPath + '/industry/findByPage.shtml',//表格数据请求地址
				//button: data,
				success:function(){
					 //将事件绑定在body上
					 //将事件绑定在body上
					industry = function(e){
						    var e = e||window.event;
						    var target = $(e.target || e.srcElement);
						    //新增
						    if(target.hasClass('addFun')){
						    	cover._Body();//防止多次点击
						    	var id = target.parent().parent().attr('dataid');
						    	_click(operation.addFun,'addFun',id)
						    }
						    // 编辑
						    if(target.hasClass('editFun')){
						    	cover._Body();//防止多次点击
						    	var id = target.parent().parent().attr('dataid');
						    	_click(operation.editFun,'editFun',id)
						    }
						   //  删除
						    if(target.hasClass('delFun')){
						    	cover._Body();//防止多次点击
						    	var id = target.parent().parent().attr('dataid');
						    	_click(operation.delFun,'delFun',id)
						    }
						    // 下拉选择
						    if(target.hasClass('editdropdownFun')){
						    	cover._Body();//防止多次点击
						    	var id = target.parent().parent().attr('dataid');
						    	_click(operation.editdropdownFun,'editdropdownFun',id)
						    }
					   }
					   $("#industry_wrapper").off("click", industry);//这个鬼东西，不知道是什么来的
					   $("#industry_wrapper").on('click', industry);
				}
			 });
		}
	})



});
	
	